<?php
	require_once("includes/functions.inc");
	// Connect to Content Manager
	require_once("includes/CMBGenericWebService.php");
	$service = new CMBGenericWebService("db28cm", "cmjphp", "php1read");
	error_reporting(-1);
	set_time_limit(500);

	$search = "/PHOTO01";
    $results = "0";
	$result = $service->search($search, $results);
	$xml = simplexml_load_string($result->processXMLRequestReturn->xmlResponseText);
	unset($result);
	if($xml->ResultSet->attributes()->count > 0){
		foreach( $xml->ResultSet->Item as $item ){
			$items[] = $item;
		}
		unset($xml);
		$i = 0;
		foreach($items as $item){
			$URI = $item->attributes()->URI;
			$attrs = $item->children()->children()->attributes();
			//echo $attrs["Image"] . "<br />";
			// generate thumbnails for all records
            thumbnail(htmlentities($URI),$attrs["Image"]);
		}
	}
    
?>